package com.sf.fy.uav.order.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sf.fy.uav.common.request.order.AnswerFeedbackRequest;
import com.sf.fy.uav.common.request.order.CloseFeedbackRequest;
import com.sf.fy.uav.common.request.order.FeedbackRequest;
import com.sf.fy.uav.common.request.order.SysFeedbackRequest;
import com.sf.fy.uav.common.response.order.SysFeedbackResponse;
import com.sf.fy.uav.common.response.user.UserDetailResponse;
import com.sf.fy.uav.order.entity.Feedback;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 反馈 服务类
 * </p>
 *
 * @author LTQ
 * @since 2023-06-09
 */
public interface IFeedbackService extends IService<Feedback> {
    /**
     * 添加反馈
     *
     * @param feedbackRequest
     * @return
     */
    Feedback add(@RequestBody FeedbackRequest feedbackRequest);

    /**
     * 获取总用户数
     *
     * @return
     */
    Long getTotal(@RequestParam(required = false) String orderId,
                  @RequestParam(required = false) String workOrderNum, @RequestParam(required = false) Integer status, @RequestParam(required = false) String feedbackTypeName,
                  @RequestParam(required = false) Integer platformCode);


    /**
     * 获取用户
     *
     * @param sysFeedbackRequest
     * @return
     */
    List<SysFeedbackResponse> getFeedbacks(SysFeedbackRequest sysFeedbackRequest);

    /**
     * 回复工单
     *
     * @param answerFeedbackRequest
     */
    void answer(AnswerFeedbackRequest answerFeedbackRequest);

    /**
     * 回复工单
     *
     * @param idRequest
     */
    void close(CloseFeedbackRequest closeFeedbackRequest);

    /**
     * 插入
     *
     * @param entity
     * @return
     */
    int insert(Feedback entity);

    /**
     * 查询列表
     *
     * @param queryWrapper
     * @return
     */
    List<Feedback> selectList(@Param(Constants.WRAPPER) Wrapper<Feedback> queryWrapper);

    /**
     * 分页查询
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<Feedback> selectPage(Page<Feedback> page, @Param(Constants.WRAPPER) Wrapper<Feedback> queryWrapper);

    /**
     * 通过用户id查询
     * @param userId
     * @return
     */
    Page<Feedback> selectPageListByUserId(Integer page,Integer size,String userId);
}
